<!--危房整治-->
<template>
  <div id="CollaborativeDepartment">
    <div style="padding: 10px">
      <van-cell-group>
        <van-field @blur="getData" right-icon="search" style="background: #EEEEEE;border-radius: 5px;" v-model="value" placeholder="请输入信息" />
      </van-cell-group>
    </div>
    <div v-if="contentData.length==0" style="height: 78vh;text-align:center;padding-top: 20vh;">
      <div style="margin-bottom: 10px;">
        <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png" />
      </div>
      <div>暂无数据</div>
    </div>
    <div class="content" v-else>
      <ul>
        <li v-for="(item,index) in contentData" @click="contentDataClick(item)" :key="index">
          <p style="font-weight: bold;height: 30px;">
            <span style="float: left">户主姓名：{{item.SQR}}</span>
          </p>
          <p style="font-size: 14px;color: #848484;height: 30px;">
            <span style="float: left">发送时间：{{item.SQSJ}}</span>
            <span style="float: right">初判结论：{{item.AQYHCP}}</span>
          </p>
          <p style="font-size: 14px;color: #848484;height: 30px;">
            <span style="float: left">具体用途：{{item.FWYT}}</span>
            <span style="float: right">排查结论：{{item.CBJD}}</span>
          </p>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
  import { FileServerProxy, } from '../../../utils/api'
  export default {
    data() {
      return {
        value:'',
        nowIndex: 0,
        contentData: [],
      }
    },
    methods: {
      onClickLeft() {
        this.$router.push({
          path: '/FeatureList'
        })
      },
      bottomClick(index) {
        this.nowIndex = index
        this.getData()
      },
      getData: async function (){
        let params = {
          accessCode: '688bd3883572440a859dfd8ba9194e7b',
          cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '441300000000',
          params: {
            dataguid: 'b5806775-2ca6-4301-971f-9b54efa1e902',
            searchObject: JSON.stringify([
              {
                field: "SQR",
                value: this.value,
                operator: "like",
              },
            ]),
            token: window.localStorage.getItem('token')
          }
        }
        const res = await FileServerProxy(params)
        let data = JSON.parse(res.data.data).Data
        console.log(data)
        this.contentData = data
        let params1 = {
          accessCode: '688bd3883572440a859dfd8ba9194e7b',
          cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '441300000000',
          params: {
            dataguid: "693a89f1-b781-49d7-b36f-cbb79fbc876d",
            searchObject: JSON.stringify([]),
            token: window.localStorage.getItem('token')
          }
        }
        const res1 = await FileServerProxy(params1)
        let data1 = JSON.parse(res1.data.data).Data
        console.log(data1)
        this.contentData = data.concat(data1);
        console.log( this.contentData)
        // this.contentData = data
      },
      contentDataClick(item) {
          this.$router.push({
            path: '/CollaborativeDepartmentDetail',
            query:{
              data:JSON.stringify(item),
            }
          })
      }
    },
    mounted(){
      this.getData()
      dd.ready(function () {
        dd.setTitle({
          title: '部门协同'
        })
          .then(res => {
          })
          .catch(err => {
            console.error(err)
          })
      })
    }
  }
</script>
<style lang="scss" scoped >
  #CollaborativeDepartment {
    height: 100vh;
    overflow: auto;
    background: #ffffff;
    /*font-size: 14px;*/
    .title {
      width: 100%;
      height: 50px;
      background: #007aff;
      line-height: 50px;
      text-align: center;
      color: #ffffff;
      font-size: 20px;
      position: relative;
    }
    .content {
      height: calc(100vh - 64px);
      overflow: auto;
      padding: 10px;
      ul li {
        height: 95px;
        border-bottom: 1px solid #d2d2d2;
        margin-bottom: 10px;
      }
    }
    .bottom {
      height: 60px;
      padding-top: 10px;
      text-align: center;
      ul li {
        float: left;
        width: 50%;
      }
    }
  }
</style>
